package com.sntk.organauthomanager.domain.model;

import com.sntk.organauthomanager.infrastructure.exception.DataEmptyException;
import lombok.Getter;

import java.util.Set;

/**
 * @ClassName: UserResource
 * @author: wgchao
 * @createTime: 2020/9/9 8:37 AM
 * @Description: 用户独有资源
 */
@Getter
public class UserResource extends AggregateRoot {

    //唯一标识
    private UserResourceIdentify identify;

    //资源列表
    private Set<String> resources;

    public UserResource(UserResourceIdentify identify, Set<String> resources) {
        if(identify == null){
            throw new DataEmptyException("标识缺失");
        }
        this.identify = identify;
        this.resources = resources;
    }
}
